package com.bwie.utils;

import lombok.Data;

/**
 * description:
 *
 * @Author zhaohaoyang
 * @Create 2025/6/6 15:38
 * @Version 1.0
 */
@Data
public class Result {

    private Integer code;

    private String msg;

    private Object Data;



    public static Result ok(){
        Result result = new Result();
        result.setCode(200);
        result.setMsg("操作成功");
        result.setData(null);
        return result;
    }

    public static Result error(){
        Result result = new Result();
        result.setCode(500);
        result.setMsg("操作失败");
        result.setData(null);
        return result;
    }

    public Result setCode(int code){
        this.code=code;
        return this;
    }
    public Result setMsg(String msg){
        this.msg=msg;
        return this;
    }
    public Result setData(Object data){
        this.Data=data;
        return this;
    }
}
